package StudyTest;

/**
 *
 * 关于变量的赋值
 *
 *  如果变量是基本数据类型，此时赋值的是变量所保存的数据值
 *  如果数据是引用数据类型，此时赋值的是变量所保存的数据的地址值
 *
 * */

public class ValueTransferTest {
    public static void main(String[] args) {
        int m = 20;
        int n = m;

        System.out.println("**********基本数据类型**********");
        System.out.println("m = " + m + ",n =" + n);

        n = 10;
        System.out.println("m = " + m + ",n =" + n);

        System.out.println("**********引用数据类型**********");


        Order order = new Order();
        order.orderId = 1000;
        Order order1 = order;
        System.out.println("order.orderID = " + order.orderId + "order1.orderID = " + order1.orderId);

    }
}

class Order{
    int orderId;
}